package cn.ecnu.common;

import org.apache.commons.lang3.StringUtils;

public class Permission {
    public static final String USER = "user";
    public static final String ADMIN = "admin";

    public static boolean hasPermission(String value, String permission) {
        return StringUtils.equalsIgnoreCase(value, "admin") || StringUtils.equalsIgnoreCase(value, permission);
    }

    public static boolean isAdmin(String value) {
        return hasPermission(value, ADMIN);
    }


}
